/*
 * SaleBO.java
 *
 * Created on March 28, 2007, 7:34 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

//package edu.byu.isys413.pb88.data;
package finalintex2web;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author Owner
 */
public class SaleBO extends RevenueSourceBO 
{
    
    /** Creates a new instance of SaleBO */
   private int quantity;
   private boolean dirty;
   private boolean alreadyInDB;
   private ProductBO product;
   SaleBO(String id)
    {
        //creates the Revenue Source object as well
        super(id);
          
    }
    /*This method gets the quantity of the Sale that has been made.
     *@return quantity
     */
    public int getQuantity() 
    {
        return quantity;
    }
    
    /*This method sets the quantity of the Sale that has been made.
     *@param quantity
     */
    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
     /**
     * This method enables us to know if the object is dirty. If the object is dirty then we need to update it in the database.
     *If the object is not dirty then we dont need to update the object in the database.
     * @return 
     */
    public boolean isDirty() {
        return dirty;
    }
    
    /**
     * 
     * @param dirty 
     * Sets the object as dirty or not dirty depending on the parameter passed.
     */
    
    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }
    
    /**
     * @return boolean indb 
     * This method is to check if this object is already set in the database or not.
     *
     */
    
    public boolean isAlreadyInDB() {
        return alreadyInDB;
    }
    
    /**
     * @param indb
     * Sets the indb variable to whatever is passed in indb.
     *This method is to tell the object that this object has already been saved or not saved in the database. 
     */
    public void setAlreadyInDB(boolean alreadyInDB) 
    {
        this.alreadyInDB = alreadyInDB;
    }

    public ProductBO getProduct() {
        return product;
    }

    public void setProduct(ProductBO product) {
        this.product = product;
    }

}
    

